﻿using System;

namespace SpiderMonkey
{
    [Flags]
    public enum ClassFlags : uint
    {
        None = 0x00,
        /// <summary>
        /// This class uses private data. If this flag is set, each instance of the class has a field for private data. The field can be accessed using JS_GetPrivate and JS_SetPrivate.
        /// </summary>
        HasPrivate = 0x01,
        /// <summary>
        /// This class's enumerate hook is actually a JSNewEnumerateOp, not a JSEnumerateOp.
        /// </summary>
        NewEnumerate = 0x02,
        /// <summary>
        /// This class's resolve hook is actually a JSNewResolveOp, not a JSResolveOp.
        /// </summary>
        NewResolve = 0x04,
        /// <summary>
        /// The resolve hook expects to receive the starting object in the prototype chain passed in via the *objp in/out parameter. (This is meaningful only if the JSCLASS_NEW_RESOLVE flag is also set.)
        /// </summary>
        NewResolveGetsStart = 0x20,
        /// <summary>
        /// Instructs JS_InitClass to invoke the constructor when creating the class prototype.
        /// </summary>
        ConstructPrototype = 0x40,
        /// <summary>
        /// Indicates that the mark hook implements the new JSTraceOp signature instead of the old JSMarkOp signature. This is recommended for all new code that needs custom marking.
        /// </summary>
        MarkIsTrace = 0x80000,
        /// <summary>
        /// This flag is only relevant for the class of an object that is used as a global object. (ECMAScript specifies a single global object, but in SpiderMonkey the global object is the last object in the scope chain, which can be different objects at different times. This is actually quite subtle. JS_ExecuteScript and similar APIs set the global object for the code they execute. JS_SetGlobalObject sets an object which is sometimes used as the global object, as a last resort.)
        /// </summary>
        GlobalFlags = 0x47b00,
    }
}